﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace WindowsGame1
{
    class Level1 : Scene
    {
        Player player1;

        string name;
        float shotsFired;
        SpriteFont Font;

        float direcao = 1;

        public Level1()
            : base()
        {



        }

        public override void Load(ContentManager Content)
        {
            Animation[] animations = new Animation[1];
            animations[0].name = "Standing";
            animations[0].currentFrame = Vector2.Zero;
            animations[0].frameRate = 1000 / 24;
            animations[0].frameSize = new Vector2(39, 43);
            animations[0].totalFrames = new Vector2(0, 3);
            animations[0].startP = new Vector2(39,0);

            player1 = new Player(Vector2.Zero, Color.White,
               Content.Load<Texture2D>("ShipSpriteSheet"), animations);

            animations[0].name = "Weak Shot";
            animations[0].currentFrame = Vector2.Zero;
            animations[0].frameRate = 1000 / 24;
            animations[0].frameSize = new Vector2(3, 9);
            animations[0].totalFrames = new Vector2(2, 0);
            animations[0].startP = new Vector2(0,220);
            player1.LoadShotManager(10, Content.Load<Texture2D>("AtackSpriteSheet"), animations, 10);
        }
        public override void Update(GameTime gameTime)
        {
            player1.Origem = new Vector2(player1.Retangulo.Width / 2, player1.Retangulo.Height / 2);
            player1.Update(gameTime);
            shotsFired += player1.Fire(gameTime);
        }
        public override void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {

            player1.Draw(spriteBatch);
           

        }
    }
}
